import Vue from 'vue'
import VueRouter from 'vue-router'
// import HomeView from '../views/HomeView.vue'
import login from  '../views/login.vue'
import SystemAdmin from '../views/SystemAdmin'
import DormitoryAdminManager from "../views/DormitoryAdminManager";
import DormitoryAdminAdd from "../views/DormitoryAdminAdd";
import DormitoryAdminUpdate from "../views/DormitoryAdminUpdate";
import StudentAdd from "../views/StudentAdd";
import StudentManager from "../views/StudentManager";
import StudentUpdate from "@/views/StudentUpdate";
import BuildingAdd from "@/views/BuildingAdd";
import BuildingManager from "@/views/BuildingManager";
import BuildingUpdate from "@/views/BuildingUpdate";
import DormitoryAdd from "@/views/DormitoryAdd";
import DormitoryManager from "@/views/DormitoryManager";
import DormitoryUpdate from "@/views/DormitoryUpdate";
import MoveoutRegister from "@/views/MoveoutRegister";
import MoveoutRecord from "@/views/MoveoutRecord";
import AbsentRecord from "@/views/AbsentRecord";
import DormitoryAdmin from "@/views/DormitoryAdmin";
import AbsentRegister from "@/views/AbsentRegister";
import CleanRecord from "@/views/CleanRecord";
import CleanRegister from "@/views/CleanRegister";

Vue.use(VueRouter)

const routes = [
  {
    path: '/dormitoryAdmin',
    name: '宿舍管理员',
    component: DormitoryAdmin,
    redirect: '/absentRegister',
    children:[
      {
        path: '/absentRecord2',
        name: '缺寝记录',
        component: AbsentRecord
      },
      {
        path: '/absentRegister',
        name: '缺寝登记',
        component: AbsentRegister
      },
      {
        path: '/CleanRecord2',
        name: '卫生记录',
        component:CleanRecord
      },
      {
        path: '/CleanRegister',
        name: '缺寝登记',
        component: CleanRegister
      },
    ]
  },
  {
    path: '/SystemAdmin',
    name: '系统管理员',
    component: SystemAdmin,
    redirect:'/DormitoryAdminManager',
    children:[
      {
        path: '/DormitoryAdminManager',
        name: '宿管管理',
        component: DormitoryAdminManager
      },
      {
        path: '/DormitoryAdminAdd',
        name: '宿管添加',
        component: DormitoryAdminAdd
      },
      {
        path: '/DormitoryAdminUpdate',
        name: '宿管编辑',
        component: DormitoryAdminUpdate
      },
      {
        path: '/StudentAdd',
        name: '添加学生',
        component: StudentAdd
      },
      {
        path: '/StudentManager',
        name: '学生管理',
        component: StudentManager
      },
      {
        path: '/StudentUpdate',
        name: '修改学生',
        component: StudentUpdate
      },
      {
        path: '/BuildingAdd',
        name: '添加楼宇',
        component: BuildingAdd
      },
      {
        path: '/BuildingManager',
        name: '楼宇管理',
        component: BuildingManager
      },
      {
        path: '/BuildingUpdate',
        name: '修改楼宇',
        component: BuildingUpdate
      },
      {
        path: '/DormitoryAdd',
        name: '添加宿舍',
        component:DormitoryAdd
      },
      {
        path: '/DormitoryManager',
        name: '宿舍管理',
        component:DormitoryManager
      },
      {
        path: '/DormitoryUpdate',
        name: '修改宿舍',
        component:DormitoryUpdate
      },
      {
        path: '/MoveoutRegister',
        name: '迁出登记',
        component:MoveoutRegister
      },
      {
        path: '/MoveoutRecord',
        name: '迁出记录',
        component:MoveoutRecord
      },
      {
        path: '/AbsentRecord',
        name: '缺寝记录',
        component:AbsentRecord
      },
      {
        path: '/CleanRecord',
        name: '卫生记录',
        component:CleanRecord
      },
    ]
  },
  {
    path: '/',
    name: '登录',
    component: login
  },
  {
    path: '/login',
    name: '登录',
    component: login
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
